{% extends "base.html" %}
{% block title %}
    技术总列表
{% endblock %}
{% block logo %}
    {% if user.is_staff %}
        <span href="" class="dropdown-toggle"><i class="fa fa-user"></i>  {{ user.username }}
            <ul class="dropdown-menu">
                <li><a href="/psw-modify/">修改密码</a></li>
                <li><a href="/user-list/">用户管理</a></li>
            </ul>
        <script type="text/javascript">
            $(function(){
                $(".dropdown-toggle").hover(function(){
                    $(".dropdown-menu").toggle();
                })
            })
        </script>
    {% else %}
        <span href="" class="dropdown-toggle"><i class="fa fa-user"></i>  {{ user.username }}
            <ul class="dropdown-menu">
                <li><a href="/psw-modify/">修改密码</a></li>
{#                <li><a href="/user-list/">用户管理</a></li>#}
            </ul>
        <script type="text/javascript">
            $(function(){
                $(".dropdown-toggle").hover(function(){
                    $(".dropdown-menu").toggle();
                })
            })
        </script>
    {% endif %}
</span> | <a href="/logout/">退出</a>
{% endblock %}
{% block content %}
    <script type="text/javascript">
        /*-------window load------*/
        var url = window.location.href;
        var arr = url.split("#");
        if (arr[1]) {
            var param = arr[1].split("&");
            var type=param[0].replace('tp','');
            var page=param[1].replace('pg','');
            loadData(tec_type , page);
        }
    </script>
                <div class="left-box">
                    <div>
                    </div>
                    <h4 class="mb10 mt10 ml10"><b>修复技术分类</b></h4>
                    <div class="detail-sel-condition ml10 clearfix">
                        <form action="/tec_filter/" method="post">
                            <div class="sel-tit">修复技术</div>
                            <p>污染物种类:</p>
                            <select name="pollutant_type">
                                <option value="">--请选择--</option>
                                <option value="重金属">重金属</option>
                                <option value="有机物">有机物</option>
                            </select>
                            <p>污染物存在介质:</p>
                            <select name="pollutant_media">
                                <option value="">--请选择--</option>
                                <option value="土壤">土壤</option>
                                <option value="地下水">地下水</option>
                                <option value="沉积物">沉积物</option>
                                <option value="固废">固废</option>
                            </select>
                            <p>处置地点:</p>
                            <select name="pollutant_dispose">
                                <option value="">--请选择--</option>
                                <option value="原位">原位</option>
                                <option value="异位">异位</option>
                            </select>
                            <div class="sel-tit">修复技术适应性</div>
                            <p>时间:</p>
                            <select name="time">
                                <option value="">--请选择--</option>
                                <option value="长">长</option>
                                <option value="短">短</option>
                            </select>
                            <p>成本:</p>
                            <select name="cost">
                                <option value="">--请选择--</option>
                                <option value="高">高</option>
                                <option value="中">中</option>
                                <option value="低">低</option>
                            </select>
                            <p>成熟度:</p>
                            <select name="tec_mature">
                                <option value="">--请选择--</option>
                                <option value="True">成熟</option>
                                <option value="False">不成熟</option>
                            </select>
                            <p>污染物浓度:</p>
                            <select name="tec_poll_density">
                                <option value="">--请选择--</option>
                                <option value="高">高</option>
                                <option value="中">中</option>
                                <option value="低">低</option>
                            </select>
                            <input class="mt20 mb10 fr" type="submit" value="筛 选">
                        </form>
                    </div>
                </div>
    <form action="/tec_export/" method="post">
                <div class="right-box">
                    <div class="data-lists">
                    <div class="tools clearfix">
                        <div class="sel-condition">
                            <form>
                                <label>技术大类 : </label>
                                <select id="sel" class="mr30">
                                    <option>全部</option>
                                    <option>物理</option>
                                    <option>化学</option>
                                    <option>生物</option>
                                    <option>组合</option>
                                </select>
                            </form>
                        </div>

                        <div class="child-tools">
                            <a href="/tec_add/"><input type="button" value="添 加"></a>
                            <a id="compare"><input type="button" value="比 较"></a>
                            <a id="export"><input type="submit" value="导 出"></a>
                        </div>
                    </div>
                    <div id="data_table" class="data-table">
                        <table>

                            <tr>
                                <th><input type="checkbox" id="all_checked"  name="list"></th>
                                <th>技术名称</th>
                                <th>技术类别</th>
                                <th>技术详情</th>
                                <th>操作</th>
                            </tr>
                            {% for technology in contacts %}
                            <tr>
                                <td><input type="checkbox"  name="list" value="{{ technology.id }}"></td>
                                <td>{{ technology.name }}</td>
                                <td>{{ technology.type }}</td>
                                <td class="tec-detail">
                                    <p><a href="/tec_intro/{{ technology.id }}/"><b class="Pb">● </b>技术简介</a></p>
                                    <p><a href="/tec_adapt/{{ technology.id }}/"><b class="Pb">● </b>适应性</a></p>
                                    <p><a href="/tec_apply/{{ technology.id }}/"><b class="Pb">● </b>应用情况</a></p>
                                </td>
                                <td><a href="/tec_modify/{{ technology.id }}/">修改 / </a>
                                    <a href="/tec_delete/{{ technology.id }}/">删除</a></td>
                            </tr>
                            {% endfor %}

                        </table>
                    </div>
                        <div class="paging clearfix">

                            <ul class="clearfix">
                                <li><a href="?page=1">首页</a></li>
                                {% if contacts.has_previous %}
                                    <li><a href="?page={{ contacts.previous_page_number }}">&lt;</a></li>
                                {% else %}
                                     <li><a disabled>&lt;</a></li>
                                {% endif %}
                                {% for p in paginator.page_range %}
                                    {% ifequal p contacts.number %}
                                         <li class="active"><a disabled class="p">{{p}}</a></li>
                                    {% else%}
                                         <li><a href="?page={{ p }}">{{p}}</a></li>
                                    {% endifequal %}
                                {% endfor %}
                                {% if contacts.has_next %}
                                    <li><a href="?page={{ contacts.next_page_number }}">&gt;</a></li>
                                {% else %}
                                     <li><a disabled> &gt;</a></li>
                                {% endif %}
                                 <li><a href="?page={{ paginator.num_pages }}">尾页</a></li>
                            </ul>
                        </div>
                </div>
                </div>
    </form>
{% endblock %}